package com.yr.ryjk.sysuser.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Update;

import com.yr.ryjk.sysuser.entity.SysUser;

public interface SysUserMapper {
    int deleteByPrimaryKey(String suName);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(String suName);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

	List<SysUser> selectOfPage(int pageNo, int pageSize,
			@Param("suName") String suName,
			@Param("suAddman") String suAddman);
	
	int selectCount(@Param("suName") String suName,@Param("suAddman") String suAddman);
	
	@Update("update sys_user set su_password=#{1} where su_name=#{0}")
	@ResultType(Integer.class)
	int updatePw(String suName,String newpw);

	SysUser selectByNameAndPwd(String name, String pwd);

	void deleteByPriKeys(String[] suName);
	
	@Update("update sys_user s set s.su_last_login_time=NOW() where s.su_name = #{0}")
	void updateLastLoginDate(String suName);

	@Delete("delete from sys_user where find_in_set(su_name,#{0})")
	void deleteBySuNames(String suNames);
}